package com.cykj.admin.controller;

import com.cykj.admin.annotation.MyLog;
import com.cykj.admin.service.IAuditRecordService;
import com.cykj.admin.vo.AuditRecordVO;
import com.cykj.common.dto.ResponseDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject:@BelonqsPackage:com.cykj.admin.controller
 * @Author:jiangna
 * @CreateTime:2025-08-25 09:40
 */
@Tag(name = "AuditRecordController",description = "企业招聘审核记录")
@RestController
@RequestMapping("/auditRecord")
public class AuditRecordController {

    @Autowired
    private IAuditRecordService auditRecordService;

    /**
    * @Description: 获取所有企业的招聘记录 / 有条件查询
    * @Param: [auditRecordVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @Operation(summary = "平台端获取所有企业的招聘记录信息接口")
    @GetMapping("/selectAllAuditRecord")
    public ResponseDTO selectAllAuditRecord(AuditRecordVO auditRecordVO) {
        return auditRecordService.selectAllAuditRecord(auditRecordVO);
    }

    /**
    * @Description: 审核企业招聘信息（通过/不通过
    * @Param: [auditRecordVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("审核招聘信息")
    @Operation(summary = "平台端审核企业招聘信息（通过/不通过）接口")
    @PutMapping("checkAuditRecord")
    public ResponseDTO checkAuditRecord(@RequestBody AuditRecordVO auditRecordVO) {
        return auditRecordService.checkAuditRecord(auditRecordVO);
    }

    /**
    * @Description: 按时间范围统计已发布招聘信息的浏览量排行
    * @Param: [rangeType]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @Operation(summary = "平台端根据时间统计招聘信息浏览量接口")
    @GetMapping("/selectRecruitsByVisitCount")
    public ResponseDTO selectRecruitsByVisitCount(@RequestParam("rangeType") String rangeType) {
        return auditRecordService.selectRecruitsByVisitCount(rangeType);
    }


}
